const state = {
  subject: null,
  folderUrl: null,
  userLoginName: null,
  studentInfo: {},
  screenShotSize: {}
}

const mutations = {
  SET_SUBJECT(state, val) {
    state.subject = val
  },
  SET_FOLDER_URL(state, val) {
    state.folderUrl = val
  },
  SET_STUDENT_INFO(state, val) {
    state.studentInfo = val
  },
  SET_USER_LOGIN_NAME(state, val) {
    state.userLoginName = val
  },
  SET_SCREEN_SHOT_SIZE(state, val) {
    state.screenShotSize = val
  }
}

const actions = {
  setSubject({commit}, val) {
    // do something async
    commit('SET_SUBJECT', val)
  },
  setFolderUrl({commit}, val) {
    // do something async
    commit('SET_FOLDER_URL', val)
  },
  setStudentInfo({commit}, val) {
    // do something async
    commit('SET_STUDENT_INFO', val)
  },
  setUserLoginName({commit}, val) {
    // do something async
    commit('SET_USER_LOGIN_NAME', val)
  },
  setScreenShotSize({commit}, val) {
    // do something async
    commit('SET_SCREEN_SHOT_SIZE', val)
  }
}

const getters = {
  userLoginName: state => state.userLoginName,
  screenShotSize: state => state.screenShotSize
}
export default {
  state,
  mutations,
  actions,
  getters
}
